﻿using QuanLyGiaoVuDAL.DTO;
using QuanLyGiaoVuUI.Models.GiangVienClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace QuanLyGiaoVuUI.Models.Mappers
{
    public static class GiangVienClientViewModelMapper
    {
        public static GiangVienClientViewModel ToGiangVienClientViewModel(this GiangVienDTO giangVienDTO)
        {
            GiangVienClientViewModel giangVienClientViewModel = new GiangVienClientViewModel();
            giangVienClientViewModel.ID = giangVienDTO.ID;
            giangVienClientViewModel.MaGiangVien = giangVienDTO.MaGiangVien;
            giangVienClientViewModel.HoTenGV = giangVienDTO.HoTenGV;
            giangVienClientViewModel.GioiTinh = giangVienDTO.GioiTinh == 1 ? "Nam" : "Nữ";
            giangVienClientViewModel.DiaChi = giangVienDTO.DiaChi;
            giangVienClientViewModel.Email = giangVienDTO.Email;
            giangVienClientViewModel.HocVi = giangVienDTO.MaHocVi;
            giangVienClientViewModel.HocHam = giangVienDTO.MaHocHam;
            giangVienClientViewModel.MaChucDanh = giangVienDTO.MaChucDanh;
            giangVienClientViewModel.NgayVaoCongTac = giangVienDTO.NgayVaoCongTac;
            giangVienClientViewModel.SoDienThoai = giangVienDTO.SoDienThoai;
            giangVienClientViewModel.NgaySinh = giangVienDTO.NgaySinh;
            return giangVienClientViewModel;
        }

        #region ThemGiangVienViewModel
        //public static IEnumerable<GiangVienClientViewModel> ToGiangVienClientViewModelList(this IEnumerable<GiangVienDTO> giangVienDTOList)
        //{
        //    List<GiangVienClientViewModel> giangVienViewModelList = new List<GiangVienViewModel>();
        //    foreach (GiangVienDTO giangvienDTO in giangVienDTOList)
        //    {
        //        giangVienViewModelList.Add(giangvienDTO.ToGiangVienViewModel());
        //    }
        //    return giangVienViewModelList.AsEnumerable<GiangVienViewModel>();
        //}
        #endregion
    }
}